//
//  YYT_MySearchViewController.m
//  AudioVisualFeast
//
//  Created by 张琪 on 16/2/26.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "QL_MySearchViewController.h"

@interface QL_MySearchViewController ()
@property (nonatomic, retain)UIWebView *webView;
@end

@implementation QL_MySearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"搜索";
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"iconfont-newbackbtn.png"] style:UIBarButtonItemStylePlain target:self action:@selector(backAction:)];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
    self.view.backgroundColor = [UIColor blackColor];
    NSString *str = @"http://www.yinyuetai.com";
    
    NSURL *url = [[NSURL alloc]initWithString:str];
    NSURLRequest  *request = [[NSURLRequest alloc]initWithURL:url];
    self.webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.frame.size.height)];
    self.webView.tag = 1000;
    [self.webView loadRequest:request];
    [self.view addSubview:_webView];

}
- (void)backAction:(UIBarButtonItem *)btn{
    if ([self.webView canGoBack]) {
        [self.webView goBack];
    } else {
        [self.navigationController popViewControllerAnimated:YES];
    }
    self.hidesBottomBarWhenPushed = NO;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
